package org.ekstrabilet.main.gui.tabs;

import java.awt.BorderLayout;

import javax.swing.JPanel;
import javax.swing.JTabbedPane;

import org.ekstrabilet.main.gui.panes.Panes;
import org.ekstrabilet.search.gui.SearchPanel;
import org.ekstrabilet.stadium.StadiumViewPane;
import org.ekstrabilet.ticket.CartPane;

/**
 * Sales service tab GUI class.
 *
 */
public class SalesTab {
	
	private JPanel pane;
	private JTabbedPane tab;
	private JPanel searchTab;
	private JPanel salesTab;
	private JPanel cartTab;
	
	public SalesTab() {
		tab = new JTabbedPane();
		SearchPanel searchPanel = new SearchPanel();
		searchTab = searchPanel.getPanel();
		cartTab = new CartPane();
		salesTab = new StadiumViewPane(true, (CartPane) cartTab);
		searchPanel.setStadiumViewPane((StadiumViewPane)salesTab);
		tab.add(Panes.SEARCH, searchTab);
		tab.add(Panes.SALE, salesTab);
		tab.add(Panes.CART, cartTab);
		
		pane = new JPanel(new BorderLayout(10, 10));
		pane.add(tab);
	}
	
	public JPanel getTab() {
		return pane;
	}
}
